package com.eastfair.security.config;

import com.eastfair.security.apiconditioncore.RequestMappingHandlerMappingCore;
import com.eastfair.security.resolver.ContextArgumentResolver;
import lombok.AllArgsConstructor;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

import java.util.List;

/**
 * 公共配置类, 一些公共工具配置
 *
 * @author ligang
 * @date 2018/8/25
 */

//@Configuration
@AllArgsConstructor
public class LoginArgResolverConfig implements WebMvcConfigurer {


    /**
     * Token参数解析
     *
     * @param argumentResolvers 解析类
     */
    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
        argumentResolvers.add(new ContextArgumentResolver());

    }


//    /**
//     * Token参数解析
//     *
//     * @param argumentResolvers 解析类
//     */
//    @Override
//    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
//        argumentResolvers.add(new ContextArgumentResolver());
//        super.addArgumentResolvers(argumentResolvers);
//    }
//
//
//    @Override
//    public RequestMappingHandlerMapping createRequestMappingHandlerMapping() {
//        return new RequestMappingHandlerMappingCore();
//    }
}
